{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "D\n",
      "70\n",
      "\u0001 \u0002 \u0003 \u0004 \u0005 \u0006 \u0007  \n",
      "\t \n",
      " \u000e \u000f \u0010  \n",
      "\u0011 \u0012 \u0013 \u0014 \u0015 \u0016 \u0017 \u0018  \n",
      "\u0019 \u001a \u001b \u001c \u001d \u001e \u001f    \n",
      "! \" # $ % & ' (  \n",
      ") * + , - . / 0  \n",
      "1 2 3 4 5 6 7 8  \n",
      "9 : ; < = > ? @  \n",
      "A B C D E F G H  \n",
      "I J K L M N O P  \n",
      "Q R S T U V W X  \n",
      "Y Z [ \\ ] ^ _ `  \n",
      "a b c d "
     ]
    }
   ],
   "source": [
    "\n",
    "#（1）整数和ASCII互转: 求数字68对应的ASCII码字符， 求字符F的ASCII码值\n",
    "#（2）以每行8个字符打印 ASCII码表 （ascii码值100以内的）\n",
    "print(chr(68))\n",
    "print(ord(\"F\"))\n",
    "for i in range(1,101):\n",
    "    print(chr(i),end=\" \")\n",
    "    if i % 8 ==0:\n",
    "        print(\" \")\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1*1=1  \n",
      "1*2=2 2*2=4  \n",
      "1*3=3 2*3=6 3*3=9  \n",
      "1*4=4 2*4=8 3*4=12 4*4=16  \n",
      "1*5=5 2*5=10 3*5=15 4*5=20 5*5=25  \n",
      "1*6=6 2*6=12 3*6=18 4*6=24 5*6=30 6*6=36  \n",
      "1*7=7 2*7=14 3*7=21 4*7=28 5*7=35 6*7=42 7*7=49  \n",
      "1*8=8 2*8=16 3*8=24 4*8=32 5*8=40 6*8=48 7*8=56 8*8=64  \n",
      "1*9=9 2*9=18 3*9=27 4*9=36 5*9=45 6*9=54 7*9=63 8*9=72 9*9=81  \n"
     ]
    }
   ],
   "source": [
    "#打印99乘法表\n",
    "for i in range(1,10):\n",
    "    for j in range(1,i+1):\n",
    "        print(f'{j}*{i}={i*j}',end=\" \")\n",
    "    print(\" \")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "['how', 'are', 'good', 'new', 'benifit', 'no']\n",
      "['Read', 'as', 'much', 'as', 'you', 'can', 'in', 'English.', 'No', 'matter', 'what', 'it', 'is,', 'from', 'cartoons', 'to', 'British', 'literature', 'anything', 'counts.']\n",
      "False\n"
     ]
    }
   ],
   "source": [
    "#判断一个句话（一个字符串）\"Read as much as you can in English. No matter what it is, from cartoons to British literature anything counts.\"中是否包含下面单词列表中的任何一个单词：\n",
    "c=\"how are good new benifit no\"\n",
    "d = c.split()\n",
    "print(d)\n",
    "a =\"Read as much as you can in English. No matter what it is, from cartoons to British literature anything counts.\"\n",
    "b = a.split()\n",
    "print(b)\n",
    "for i in b:\n",
    "    for j in c:\n",
    "        if i==j:\n",
    "            print(\"True\")\n",
    "else:\n",
    "    print(\"False\") "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "ename": "FileNotFoundError",
     "evalue": "[Errno 2] No such file or directory: 'D:ð极速浏览器下载\\\\luningyngyu'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mFileNotFoundError\u001b[0m                         Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-25-e243ba530e7c>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[0;32m      2\u001b[0m \u001b[1;31m#2）装上述word, ppt, 和 excel分别复制到一个独立的文件夹中。\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      3\u001b[0m \u001b[1;31m#没学如何打开文件夹以及让打印文件的绝对路径\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 4\u001b[1;33m \u001b[1;32mwith\u001b[0m \u001b[0mopen\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"D:\\360极速浏览器下载\\luningyngyu\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;32mas\u001b[0m \u001b[0mf\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m      5\u001b[0m     \u001b[0ma\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mf\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mread\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      6\u001b[0m     \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0ma\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: 'D:ð极速浏览器下载\\\\luningyngyu'"
     ]
    }
   ],
   "source": [
    "#1）找一个自己电脑上文件较多、文件夹层数较多的工作文件夹，分别打印列出该文件夹（及其子文件夹）中的word, ppt, 和 excel文件的绝对路径；\n",
    "#2）装上述word, ppt, 和 excel分别复制到一个独立的文件夹中。\n",
    "#没学如何打开文件夹以及让打印文件的绝对路径\n",
    "with open(\"D:\\360极速浏览器下载\\luningyngyu\")as f:\n",
    "    a = f.read()\n",
    "    print(a)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [],
   "source": [
    "#批量修改文件后缀\n",
    "#将某一个文件夹下的所有.doc后缀的文件的文件名加上前缀\"DOC_\"进行重命名\n",
    "#没学，但我查到了，但也不太懂，那两个函数没学过"
   ]
  }
 ],
 "metadata": {
  "interpreter": {
   "hash": "a4c6f6dca0b39727a1d31abc575f26c9e9c5e97275968b776bf7d6bafbe246da"
  },
  "kernelspec": {
   "display_name": "Python 3.8.8 ('base')",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
